package com.juanable.niubility.designPatterns;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Auther: lyg
 * @Data: 2022/8/8
 */
//@Api(tags = {"策略模式接口"})
@RestController
public class StrategyController {

    @Resource
    private StatementClient<String> statementClient;
    @Resource
    private Statement2Client statement2Client;

//    @ApiOperation("容器加载")
    @GetMapping("/test/{desc}")
    public void testStrategy(@PathVariable("desc") String desc) {
        statementClient.doHandler(StrategyEnum.getDesc(desc).desc , desc);
    }

//    @ApiOperation("初始化加载")
    @GetMapping("/test2/{desc}")
    public void testStrategy2(@PathVariable("desc") String desc) {
        statement2Client.execute(desc);
    }
}
